
// https://leetcode.cn/problems/delete-node-in-a-linked-list/description/

class ListNode {
    val:number;
    next : ListNode | null;
    constructor(val?:number, next?:ListNode | null){
        this.val = val === undefined ? 0 : val;
        this.next = next === undefined ? null : next;
    }
}
// 传入的是要删除的节点
// 直接将要删除的节点的val变成下一个节点的值，然后删除下一个节点即可

function deleteNode(node:ListNode | null ): void {

    node!.val = node!.next!.val;
    node!.next = node!.next!.next
}

export default {}